//
//  MyFreeOrderTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/4.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MyFreeOrderTableViewCell.h"

@implementation MyFreeOrderTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        NSArray * freeBuyTitArr = @[@"我的购物车",@"我的关注",@"售出的订单",@"出售中的商品"];
        for (int i=0; i<4; i++) {
            CGFloat butWidth = KScreenWidth/4;
            if (i<3) {
                butWidth = butWidth - kWidthProportion_In_iPhoneTriploid(4);
            }else{
                butWidth = butWidth + kWidthProportion_In_iPhoneTriploid(12);
            }
            GLGWButton * upBut = (GLGWButton *)[self viewWithTag:212+i];
            GLGWButton * freeBut = [[GLGWButton alloc] initWithFrame:CGRectMake(kX_With_View(upBut, 0), 0, butWidth, kHeightProportion_In_iPhoneTriploid(88)) titleText:freeBuyTitArr[i] titleLableFont:SYSTEMFONT(13) titleLableColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
            freeBut.tag = 213+i;
            freeBut.backgroundColor = kRandomColor;
            [freeBut addTarget:self action:@selector(freeFourAction:) forControlEvents:UIControlEventTouchUpInside];
        }
    }
    return self;
}

-(void)freeFourAction:(GLGWButton *)sender{
    if (self.Block_FreeFourAction) {
        self.Block_FreeFourAction(sender);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
